package ph.com.isla.sf2d.ui;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Rect;
import android.graphics.RectF;

public class SF2DUtil {
	public static Paint createBorderPaint(float thickness, int color) {
		Paint paint = new Paint();
		createBorderPaint(paint, thickness, color);
		return paint;
	}
	
	public static void createBorderPaint(Paint paint, float thickness, int color) {
		paint.setStyle(Style.STROKE);
		paint.setColor(color);
		paint.setStrokeWidth(thickness);
	}
	
	public static Rect createBorderRect(int left, int top, int right, int bottom){
		Rect rect = new Rect(left, top, right, bottom);
		return rect;
	}
	
	public static RectF createInnerRect(float borderThickness, Rect dimension) {
		float left = dimension.left + 0f;
		float top = dimension.top + borderThickness;
		float right = dimension.right - 0f;
		float bottom = dimension.bottom - borderThickness;
		RectF r = new RectF(left, top, right, bottom);
		return r;
	}
	
	public static void drawDefault(Canvas canvas, Rect borderRect, Paint borderPaint, RectF innerRect, Paint innerPaint){
		canvas.drawRect(borderRect, borderPaint);
		canvas.drawRect(innerRect, innerPaint);
		
	}
}
